<?php

namespace Aspic\Service;

/**
 * A service dependency
 *
 * @property array|string $servicesNames
 * @property string $type
 * @property string $callPropName
 */
class Dependency {

	const TYPE_METHOD_CALL = 'type_method_call';

	const TYPE_CONSTRUCTOR_PARAMS = 'type_constructor_params';

	const TYPE_PROPERTY = 'type_property';

	/**
	 * @var array|string An array of services names (params names) to pass or only one service name (type_property)
	 */
	protected $_servicesNames;

	protected $_type;

	/**
	 * @var string Name of the method to call, property to set or null for constructor params
	 */
	protected $_callPropName;

	public function __construct($callPropName, $servicesNames, $type = self::TYPE_CONSTRUCTOR_PARAMS) {
		$this->_callPropName = $callPropName;
		$this->_type = $type;
		$this->_servicesNames = $servicesNames;
	}

}
